// 购物车中间件
const { CartModel } = require('../db/model')

// 查询购物车
const cartList = async (req, res, next) => {
  const userId = req.userInfo._id
  const result = await CartModel.find({ user_id: userId })
  req.cartList = result
  next()
}

module.exports = {
  cartList,
}